﻿
using Android.Content;
using Android.Graphics;
using Android.Media;
using Android.OS;
using Android.Runtime;
using Android.Views;

namespace ScreenShotDemo
{
    [Service]
    public class FloatingWindowService : Service
    {
        public override IBinder? OnBind(Intent? intent) => null;

        public override void OnCreate()
        {
            base.OnCreate();
            //悬浮窗口布局初始化
            FloatingWindowHepler.InitFloatingWindowHepler(this);
        }


        public override StartCommandResult OnStartCommand(Intent? intent, StartCommandFlags flags, int startId)
        {
            if (intent != null)
            {
                // Handle the intent here
            }
            return StartCommandResult.Sticky;
        }

        /// <summary>
        /// 销毁悬浮窗
        /// </summary>
        public override void OnDestroy() 
        {
            FloatingWindowHepler.Dispose();
        }
    }
}
